package org.ben.birthday.twentybirthday.dao;

import org.ben.birthday.twentybirthday.entity.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;

/**
 * @Author: Ben
 * @Date: 2019/7/18 18:01
 */
public interface UserDaoRepository extends JpaRepository<User,Integer> {

    /**
     *根据用户名查询
     * @param userName
     * @return List<User>
     */
    List<User> findUsersByUserName(String userName);

    /**
     * 根据邮箱查询
     * @param email
     * @return List<User>
     */
    List<User> findUsersByEmail(String email);

    /**
     * 根据用户Id删除用户
     * @param integer
     */
    @Override
    void deleteById(Integer integer);
}
